import axios from 'axios';

// export const BASEURL = 'http://192.168.199.239:8214/'
// export const BASEURL = 'https://122.114.35.47:8214/'

export const BASEURL = 'https://xzw.lnit.net/'

axios.defaults.baseURL = BASEURL;
axios.defaults.timeout = 5000;
// axios.defaults.withCredentials = true;

export const _get = (req) => {
    return axios.get(req.url, { params: req.data });
};

export const _post = (req) => {
    return axios({ method: 'post', url: `${req.url}`, data: req.data });
};

export const _put = (req) => {
    return axios({ method: 'put', url: `${req.url}`, data: req.data });
};

export const _delete = (req) => {
    return axios({ method: 'delete', url: `${req.url}`, data: req.data });
};
